<%@ page import="java.util.*" pageEncoding="utf-8" %>
<%@include file="/commons/taglibs.jsp" %>
<!DOCTYPE html>
<html>
<fmt:bundle basename="res">
<head>
    <meta charset="utf-8">
    <title><fmt:message key='syt'/></title>
    <jsp:include page="/WEB-INF/commons/commons-header.jsp" flush="true"/>
    <style>
        html {
            background: #fff;
        }
    </style>
</head>

<body>

<div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
    <div class="layui-tab-content" style="height: 100%;">
        <div class="layui-tab-item layui-show">
            <div class="layui-container">
                <div class="layui-form" lay-filter="layuiadmin-app-form-list" id="layuiadmin-app-form-list" style="padding: 20px 30px 0 0;">

                    <div class="layui-form-item">
                        <label for="" class="layui-form-label"><span style="color: red;">*</span><fmt:message key='je'/></label>
                        <div class="layui-input-inline" style="width: 70%">
                            <input type="text" class="layui-input" id="amount"/>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label for="" class="layui-form-label"><span style="color: red;">*</span><fmt:message key='fkm'/></label>
                        <div class="layui-input-inline" style="width: 70%">
                            <input type="text" class="layui-input" id="code"/>
                        </div>
                    </div>

                    <div class="layui-form-item" style="display:none">
                        <label for="" class="layui-form-label"></label>
                        <div class="layui-input-inline">
                            <input type="button" value="<fmt:message key='qd1'/>" id="submit" class="layui-btn">
                        </div>
                    </div>
                </div>
            </div>
        </div>

    </div>
</div>
<script>

    layui.use(['form'], function () {
        var form = layui.form;

        $("#code").change(function () {
            var code = $(this).val();
            if (code.length >= 18) {
                $("#submit").click();
            }
        });

        $("#submit").click(function () {

            $.ajax({
                url: "http://localhost/api/wechat/scanPay?code=" + $("#code").val() + "&amount=" + $("#amount").val(),
                type:"get",
                success: function (result) {
                    $("#amount").val("");
                    $("#code").val("");
                    layer.msg("<fmt:message key='skcg'/>");
                }
            });



        });
    });
</script>
</body>
</fmt:bundle>
</html>